Ensure drawing context is set
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 15 Sep 2016 09:05:05 +0000 (10:05 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 15 Sep 2016 09:17:24 +0000 (10:17 +0100)
commitbb705837bc878b6028069fd7537e89975d50d2ee
treedbf471977a9a1a31f0da99f3120d19e40deb293e
parent638c3e2e6bccea5c52c46ff57ed55b32f068accf
Ensure drawing context is set

If somebody decides to use gtk_widget_set_double_buffered() in the
middle of a draw() then there's the risk of calling end_draw_frame()
with an invalid pointer.

Some overeager compilers may warn about the double_buffered bit field
changing values and leading to a potentially uninitialized variable.

In order to avoid compiler warnings or crashes, we can simply store the
value of the double_buffered bit field at the beginning of the rendering
and use that instead of the actual bit field.

https://bugzilla.gnome.org/show_bug.cgi?id=771463
gtk/gtkwidget.c